<?php
$this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Login");
$this->breadcrumbs=array(
	UserModule::t("Login"),
);
?>

<h1><?php echo UserModule::t("Login"); ?></h1>

<?php if(Yii::app()->user->hasFlash('loginMessage')): ?>

<div class="success">
	<?php echo Yii::app()->user->getFlash('loginMessage'); ?>
</div>

<?php endif; ?>

<p><?php echo UserModule::t("Please fill out the following form with your login credentials:"); ?></p>

<div class="form">
<?php $form=$this->beginWidget('UActiveForm', array(
	'id'=>'login-form',
	'enableAjaxValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
	'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>
<p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
<div class="span-11">
<table class="logintable">
  <tr>
    <td  class="tablecol1">
        <?php echo CHtml::activeLabelEx($model,'username'); ?>
    </td>
    <td  class="tablecol2">
        <?php echo CHtml::activeTextField($model,'username') ?>
        <?php echo CHtml::error($model,'username'); ?>
    </td>
  </tr>
  <tr>
    <td  class="tablecol1">
        <?php echo CHtml::activeLabelEx($model,'password'); ?>
    </td>
    <td  class="tablecol2">
        <?php echo CHtml::activePasswordField($model,'password') ?>
        <?php echo CHtml::error($model,'password'); ?>
    </td>
  </tr>
  <tr>
    <td colspan="2">
		<p class="hint">
		<?php echo CHtml::link(UserModule::t("Register"),Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(UserModule::t("Lost Password?"),Yii::app()->getModule('user')->recoveryUrl); ?>
		</p>
	</td>
  </tr>
  <tr>
    <td colspan="2">
		<?php echo CHtml::activeCheckBox($model,'rememberMe'); ?>
		<?php echo CHtml::activeLabelEx($model,'rememberMe'); ?>
	</td>
  </tr>
  <tr>
    <td colspan="2">
		<?php echo CHtml::submitButton(UserModule::t("Login")); ?>
	</td>
  </tr>
</table>
</div>	
	
<?php $this->endWidget(); ?>
</div><!-- form -->


<?php
$form = new CForm(array(
    'elements'=>array(
        'username'=>array(
            'type'=>'text',
            'maxlength'=>32,
        ),
        'password'=>array(
            'type'=>'password',
            'maxlength'=>32,
        ),
        'rememberMe'=>array(
            'type'=>'checkbox',
        )
    ),

    'buttons'=>array(
        'login'=>array(
            'type'=>'submit',
            'label'=>'Login',
        ),
    ),
), $model);
?>